/**
 * 
 */
package org.softTank.BC.dao;

import org.hibernate.Hibernate;
import org.softTank.BC.entity.services.Operation;
import org.softTank.BC.entity.services.PortType;
import org.springframework.stereotype.Repository;
import org.springside.modules.orm.hibernate.HibernateDao;

/**
 * @author Yuzone
 *
 */
@Repository
public class PortTypeDao extends HibernateDao<PortType, Long> {

	@Override
	public void initEntity(PortType entity) {
		for (Operation o : entity.getOperationList()) {
			Hibernate.initialize(o);
		}
		Hibernate.initialize(entity);
	}

	@Override
	public PortType get(Long id) {
		PortType pt = super.get(id);
		initEntity(pt);

		return pt;
	}
}
